<?php
require_once 'util/delivery.inc';
require_once 'core/utils/repository.inc';

class TSimpleDelivery extends TConfigurable implements IDeliveryProvider {
	protected $_int_cost_bound_ = 0;
	protected $_int_delivery_cost_ = 0;
		
	public function DeliveryCostByCart(TCart $cart){
		$sum = $cart->TotalSum();
		if ($sum < $this->CostBound)
			return $this->DeliveryCost;
		return 0;	
	}
	
	public function DeliveryCostByOrder(TMSOrder $order){
		$sum = $order->Amount;
		if ($sum < $this->CostBound)
			return $this->DeliveryCost;
		return 0;	
	}
}